ARG BASE_IMAGE=build-go:1.10.2
FROM ${BASE_IMAGE}

ENV APISERVER_BUILDER_VERSION=v1.9-alpha.4
ENV APISERVER_BUILDER_ARCH=amd64
ENV APISERVER_BUILDER_OS=linux

ENV APISERVER_BUILDER_FILE=apiserver-builder-${APISERVER_BUILDER_VERSION}-${APISERVER_BUILDER_OS}-${APISERVER_BUILDER_ARCH}.tar.gz

RUN mkdir -p /apiserver-builder

COPY ${APISERVER_BUILDER_FILE} /tmp/${APISERVER_BUILDER_FILE}

RUN tar -zvxf /tmp/${APISERVER_BUILDER_FILE} -C /apiserver-builder && rm -rf /tmp/${APISERVER_BUILDER_FILE}

ENV APISERVER_BUILDER_PATH=/apiserver-builder/bin
ENV PATH=${PATH}:${APISERVER_BUILDER_PATH}
